package org.example.forum.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.forum.model.Message;

import java.util.List;


@Mapper
public interface MessageMapper {
    int insert(Message row);

    int insertSelective(Message row);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message row);

    int updateByPrimaryKey(Message row);

    /**
     * 根据用户id查找用户未读数
     * @param receiveUserId
     * @return
     */
    Integer selectUnreadCount(@Param("receiveUserId") Long receiveUserId);

    /**
     * 根据接收者id查找站内信列表
     * @param receiveUserId
     * @return
     */
    List<Message> selectByReceiveId(@Param("receiveUserId") Long receiveUserId);
}